import type { ComponentRegister } from "../types";

const registerComponents = new Map<string, ComponentRegister>();

export const registerComponent = (name: string, register: ComponentRegister) => {
    registerComponents.set(name, register);
}

export const getRegisterComponent = (name: string): ComponentRegister | null => {
    if (!registerComponents.has(name)) {
        return null;
    }

    return registerComponents.get(name)!;
}
